package com.heima.article.job;

import com.heima.article.service.ApArticleHotService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时计算热点文章任务类
 */
@Slf4j
@Component
public class ApArticleHotComputeJob {

    @Autowired
    private ApArticleHotService apArticleHotService;

    /**
     * 定时计算热点文章的任务
     */
    @XxlJob("computeHotArticleJob")
    public void computeHotArticle(){
        log.info("[定时计算热点文章]开始执行");
        apArticleHotService.compuateHotArticle();
        log.info("[定时计算热点文章]执行结束");
    }
}
